﻿using DDLParser.constant;
using DDLParser.model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DDLParser.sqlserver
{
    class SqlServerTermLookup : DDLTermLookup
    {
        public SqlServerTermLookup()
        {
            // must sort!!!!
            List<DDLTerm> termList = new List<DDLTerm>();
            termList.Add(new DDLTerm() { Term = SqlServerTerm.CREATE, Type = SqlServerTermType.CREATE });
            termList.Add(new DDLTerm() { Term = SqlServerTerm.TABLE, Type = SqlServerTermType.TABLE });
            termList.Add(new DDLTerm() { Term = SqlServerTerm.PROCEDURE, Type = SqlServerTermType.PROCEDURE });
            termList.Add(new DDLTerm() { Term = SqlServerTerm.END, Type = SqlServerTermType.END });
            termList.Add(new DDLTerm() { Term = SqlServerTerm.IDENTITY, Type = SqlServerTermType.IDENTITY});
            termList.Add(new DDLTerm() { Term = SqlServerTerm.NOT, Type = SqlServerTermType.NOT });
            termList.Add(new DDLTerm() { Term = SqlServerTerm.NULL, Type = SqlServerTermType.NULL });
            termList.Add(new DDLTerm() { Term = SqlServerTerm.PRIMARY, Type = SqlServerTermType.PRIMARY });
            termList.Add(new DDLTerm() { Term = SqlServerTerm.KEY, Type = SqlServerTermType.KEY });
            termList.Add(new DDLTerm() { Term = SqlServerTerm.CONSTRAINT, Type = SqlServerTermType.CONSTRAINT });
            termList.Add(new DDLTerm() { Term = SqlServerTerm.ON, Type = SqlServerTermType.ON });
            termList.Add(new DDLTerm() { Term = SqlServerTerm.ALTER, Type = SqlServerTermType.ALTER });
            termList.Add(new DDLTerm() { Term = SqlServerTerm.FOREIGN, Type = SqlServerTermType.FOREIGN });

            TermComparator comparator = new TermComparator();
            termList.Sort(comparator);

            SetTermList(termList);
        }
    }
}
